package com.chenfan.mcn.model.rpc;

import com.alibaba.fastjson.annotation.JSONType;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 财务开票回调请求
 *
 * @author wulg
 * @date 2022-07-28
 **/
@Deprecated
@EqualsAndHashCode(callSuper = true)
@Data
@JSONType(typeName = BusinessScene.BATCH_INVOICED)
public class BatchInvoicedCallback extends AbstractFinanceCallback {

    private static final long serialVersionUID = 6215716213822874844L;
    /**
     * 数据body
     */
    @Valid
    @NotEmpty(message = "数据body不能为空")
    private List<InvoicedCallbackBody> body;


    /**
     * 数据body
     */
    @Data
    public static class InvoicedCallbackBody implements Serializable {

        private static final long serialVersionUID = -68921528522648000L;
        /**
         * 开票流水号
         */
        @NotBlank(message = "开票流水号不能为空")
        private String taxInvoiceNo;


        /**
         * 开票金额
         */
        @NotNull(message = "开票金额不能为空")
        private BigDecimal invoicedAmount;

        /**
         * 收入合同号
         */
        @NotBlank(message = "收入合同号不能为空")
        private String contractCode;
    }
}
